{% extends "shop/base.html" %}

{% block title %}结账{% endblock %}

{% block content %}
  <h1>结账</h1>
  <div class="order-info">
    <h3>你的订单</h3>
    <ul>
      {% for cart in cart_items %}
        <li>
          {{ cart.quantity }}x {{ cart.item.name }}({{ cart.item.price }}): {{ cart.get_subtotal }}
        </li>
      {% endfor %}
    </ul>
    <p>总价：￥{{ total_price }}</p>
  </div>
  <form action="{% url 'checkout' %}" method="post" class="order-form">
    {{ form.as_p }}
    <p><button class="py-4 px-8 font-semibold bg-green-500 hover:bg-green-700 text-white rounded-xl">确认</button></p>
    {% csrf_token %}
  </form>
{% endblock %}